//
export{}
// 从赋值中推断出来
let foo =1
let bar = 'JINYE'; 

//通过return 关键字推断返回值的类型
//底部流出
function add(a:number,b:number){
	return a+b
}
let c = add(1,3)

//从左向右
type Sum = (a:number,b:number)=>number
let sum:Sum = (a,b)=>{
	return a+b
}

let person = {
	name:"jinyq",
	age:11
}
// let name =person.name;
// let age =person.age;
// age = 'hello';
let {name,age} = person

let number = [1,2,3]
let c2 =number[0]

interface DefaultProps{
	name?:string;
	age?:number;
}
let defaultProps = {
	name:'jin',
	age:12
}

let props = {
	...defaultProps,
	home:"上海"
}
type Props = typeof props

function addOne(a:any){
	return a+1
}
function sum3(a:number,b:number){
	return a+addOne(b)
	// return a+addOne(b) as number //可以强制转换
}
let k = sum3(1,2) //any+任何类型都是any